<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Promise 关键问题 - Promise 的then方法返回对象的特点</title>
</head>
<body>
    <script>
        let p =new Promise((resolve,reject)=>{
            resolve('OK');
        });
        let result = p.then(value=>{
            // console.log(value);

            //  1、throw出了问题
            // throw '出了问题';

            // 2、返回结果是非Promise对象
            // return 123;

            // 3、返回结果是Promise对象
            return new Promise((resolve,reject)=>{
                // resolve('success');
                reject('fail')
            })
        },reason=>{
            console.log(reason)
        });
        console.log(result)

        // result.catch(reason=>{
        //     console.log(reason)
        // })
    </script>
    
</body>
</html>